﻿using System;
using System.IO;
using System.Diagnostics;

namespace Log
{
    public static class ExceptionLogger
    {
        static readonly FileLogger FileLogger = new FileLogger("Exception");

        public static void Write(Exception exception, StackTrace stackTrace)
        {
            if (exception == null) throw new ArgumentNullException(nameof(exception));
            if (stackTrace == null) throw new ArgumentNullException(nameof(stackTrace));

            FileLogger.Write
            (
                $"{exception.ToString()}\r\n\r\n"
                + "Diagnostics.StackTrace:\r\n"
                + $"{stackTrace.ToString()}\r\n"
            );
        }
    }
}

